package org.jsola.hr.web;

import org.jsola.admin.vo.AreaListVO;
import org.jsola.approval.vo.UserApproAllInfoVO;
import org.jsola.core.Result;
import org.jsola.hr.constant.HrConstants;
import org.jsola.hr.provider.IAdminProviderService;
import org.jsola.hr.provider.IApproProviderService;
import org.jsola.hr.service.IEmpInfoService;
import org.jsola.hr.vo.EmpAndApproInfoVO;
import org.jsola.hr.vo.EmpInfoVO;
import org.jsola.user.core.TokenUser;
import org.jsola.user.core.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;


/**
 * @author zhr
 */
@RestController("hrAreaProviderController")
@RequestMapping(HrConstants.PROVIDER_PATH + "/v1/hrAreas")
public class HrAreaProviderController implements IHrAreaProviderControllerAPI {


    @Autowired
    private IAdminProviderService adminProviderService;

    @Override
    @GetMapping("/listAreaByCompany/{companyId}")
    public Result<List<AreaListVO>> listAreaByCompany(
            @PathVariable(value = "companyId") String companyId) {

        TokenUser tokenUser = UserContext.getUser();

        return Result.success(
                adminProviderService.listAreaByCompany(companyId, tokenUser)
        );
    }
}

